<template>
	<view>
		<view class="card" v-for="i in shopList" :key="i.id" @click="toDetail(i.id)">
			<u--image :showLoading="true" :src="imgBaseurl+i.sculpture" width="90px" height="90px"></u--image>
			<view class="card-right">
				<u-text :text="i.name" bold size="18"></u-text>
				<u-text :text="i.address" color="#999" size="12"></u-text>
				<view style="display: flex;">
					<u-text :text="'销量'+i.sales_volume" color="#999" size="14"></u-text>
					<!-- <u-text text="配送2" color="#999" size="14"></u-text> -->
				</view>
				<view style="display: flex;">
					<u-tag :text="i.introduce" size="mini" plain type="warning"></u-tag>
					<!-- <view v-for="t in tagsList" :key="index" style="margin-right: 10rpx;" i>
						<u-tag :text="t" size="mini" type="warning"></u-tag>
					</view> -->
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import config from '@/config.js'
	export default {
		name: "shopItem",
		props: {
			shopList: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				imgBaseurl: config.appInfo.imgBaseurl,
				tagsList: ['热情掌柜', '夏日小炒', '门店上新']
			}
		},
		methods: {
			toDetail(id) {
				this.$emit('toDetail', id)
			}
		}
	}
</script>

<style>
	.card {
		border-radius: 20rpx;
		background-color: #fff;
		padding: 20rpx;
		width: 100%;
		height: 230rpx;
		margin-bottom: 20rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}

	.card-right {
		margin-left: 20rpx;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
	}

	.u-tag-wrapper {
		margin-right: 10rpx;
	}
</style>